import os
from typing import Optional

class Config:
    """系统配置类"""
    
    # OneAPI配置
    ONEAPI_BASE_URL = "http://localhost:3001/v1"
    ONEAPI_KEY = "sk-fnlLL7v1VLyy7hEvBbC95cD6CcCb4954954dF4A1CaEb2563"
    EMBEDDING_MODEL = "Embedding-2"
    LLM_MODEL = "GLM-4-AirX"
    
    # MongoDB配置
    MONGODB_URI = "mongodb://root:example@localhost:27017/?directConnection=true&authSource=admin"
    DB_NAME = "pdfchatbot"
    COLLECTION_NAME = "advancedRAGParentChild"
    
    # 检索配置
    TOP_K = 5
    BM25_TOP_N = 8
    EXPANSION_TERMS = 3
    
    # 对话配置
    MAX_HISTORY = 12  # 6轮对话，每轮2条消息（用户+助手）
    MAX_TOKENS = 4000
    TEMPERATURE = 0.7
    
    # 服务器配置
    HOST = "0.0.0.0"
    PORT = 5000
    DEBUG = True
    
    # 流式配置
    STREAM_ENABLED = True
    CHUNK_SIZE = 50

# 全局配置实例
config = Config() 